// 引入页头
import React, { Component } from 'react'
import { PageHeader, Button,Input } from 'antd';
const { Search } = Input;
class Pagehead extends Component {
    render() {
        return (
            <>
                <PageHeader
                    className="site-page-header"
                    title={this.props.title}
                    style={{ border: '1px solid rgb(235, 237, 240)' }}
                    extra={ this.props.showadd? [
                        <Button key="1" type="primary" onClick={this.showModal}>
                            添加
                        </Button>,
                    ]:[
                        <Search  key="1" placeholder="请输入影院名" onSearch={this.onSearch} enterButton />
                    ]
                       
                
                
                }
                />
            </>
        );
    }
    showModal=()=> {
        this.props.showModalFn('添加用户')
    }

    onSearch= (val)=>{
        //console.log(val);
        this.props.searchFilm(val)
    }

}

export default Pagehead;